package tests;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;

/**
 * Title: ThemesTest class for CSIS 343 Final Project 
 * Description: CS 343 Final Project - ThemesTest This class will test the 
 * Themes class handles the themeing, NOT USED YET
 * 
 * @author Erik Olson
 * @email erik.olson-5@my.uwrf.edu
 * @author Mike Harmon
 * @email michael.harmon@my.uwrf.edu
 * @author Jack Friermuth
 * @email jack.friermuth@my.uwrf.edu
 * @author Luke Vang
 * @email luke.vang@my.uwrf.edu
 * @author Casey Golla
 * @email casey.golla@my.uwrf.edu
 * @date December 4th 2012
 */
public class ThemesTest extends TestCase {
	private static com.project.savelog.Themes themes_default;
	private static com.project.savelog.Themes themes_alternate;

	@Before
	public void setUp() throws Exception {
		//setting up 2 dummy objects
		themes_default = new com.project.savelog.Themes();
		themes_alternate =  new com.project.savelog.Themes( 1, "Black", "Red", "Orange", "Green" );
	}

	@After
	public void tearDown() throws Exception {
		//clearing objects out
		themes_default = null;
		themes_alternate = null;
	}

	/**
	 * Tests that the default constructor will set the correct defaults
	 * @Test
	 */
	public final void testDefaultConstructor() {
		assertEquals( themes_default.getTheme_id(), 0, 0 );
		assertEquals( themes_default.getTheme_text_primary() , "" );
		assertEquals( themes_default.getTheme_text_secondary() , "" );
		assertEquals( themes_default.getTheme_background_main() , "" );
		assertEquals( themes_default.getTheme_background_table() , "" );
	}
	
	/**
	 * Tests that the alternate constructor will set the provided values
	 * @Test
	 */
	public final void testAlternateConstructor() {
		assertEquals( themes_alternate.getTheme_id(), 1, 0 );
		assertEquals( themes_alternate.getTheme_text_primary() , "Black" );
		assertEquals( themes_alternate.getTheme_text_secondary() , "Red" );
		assertEquals( themes_alternate.getTheme_background_main() , "Orange" );
		assertEquals( themes_alternate.getTheme_background_table() , "Green" );
	}

	/**
	 * Tests that getTheme_id will return the correct theme id
	 * @Test
	 */
	public final void testGetTheme_id() {
		assertEquals( themes_alternate.getTheme_id(), 1, 0 );
	}

	/**
	 * Tests that setTheme_id will correctly set the theme id
	 * @Test
	 */
	public final void testSetTheme_id() {
		themes_alternate.setTheme_id( 2 );
		assertEquals( themes_alternate.getTheme_id(), 2, 0 );
	}

	/**
	 * Tests that getTheme_text_primary will return the correct primary text theme
	 * @Test
	 */
	public final void testGetTheme_text_primary() {
		assertEquals( themes_alternate.getTheme_text_primary() , "Black" );
	}

	/**
	 * Tests that setTheme_text_primary will correctly set the primary text theme
	 * @Test
	 */
	public final void testSetTheme_text_primary() {
		themes_alternate.setTheme_text_primary( "Blue" );
		assertEquals( themes_alternate.getTheme_text_primary() , "Blue" );
	}

	/**
	 * Tests that getTheme_text_secondary will return the correct secondary text theme
	 * @Test
	 */
	public final void testGetTheme_text_secondary() {
		assertEquals( themes_alternate.getTheme_text_secondary() , "Red" );
	}

	/**
	 * Tests that setTheme_text_secondary will correctly set the secondary text theme
	 * @Test
	 */
	public final void testSetTheme_text_secondary() {
		themes_alternate.setTheme_text_secondary( "Purple" );
		assertEquals( themes_alternate.getTheme_text_secondary() , "Purple" );
	}

	/**
	 * Tests that getTheme_background_main will return the correct main background theme
	 * @Test
	 */
	public final void testGetTheme_background_main() {
		assertEquals( themes_alternate.getTheme_background_main() , "Orange" );
	}

	/**
	 * Tests that setTheme_background_main will correctly set the main background theme
	 * @Test
	 */
	public final void testSetTheme_background_main() {
		themes_alternate.setTheme_background_main( "Yellow" );
		assertEquals( themes_alternate.getTheme_background_main() , "Yellow" );
	}

	/**
	 * Tests that getTheme_background_table will return the correct table background theme
	 * @Test
	 */
	public final void testGetTheme_background_table() {
		assertEquals( themes_alternate.getTheme_background_table() , "Green" );
	}

	/**
	 * Tests that setTheme_background_table will correctly set the table background theme
	 * @Test
	 */
	public final void testSetTheme_background_table() {
		themes_alternate.setTheme_background_table( "Teal" );
		assertEquals( themes_alternate.getTheme_background_table() , "Teal" );
	}

}
